package com.qf.shop.home.controller;

import com.qf.shop.common.constants.AuthConstants;
import com.qf.shop.common.vo.UserVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
@Slf4j
public class HomeController {

    @GetMapping("/test")
    public void test(HttpSession session){
        UserVo userVO = (UserVo) session.getAttribute(AuthConstants.LOGIN_USER);
        System.out.println(userVO);
    }

    @GetMapping("/toIndex")
    public String toIndex(){
        System.out.println("HomeController.toIndex");
        return "index";
    }
}
